Optimal. Leaf size=509 \[ -\frac{\log \left (a+b x+c x^2\right ) \left (e^3 \left (a^2 h-a b g+b^2 f\right )-c \left (a e \left (3 d^2 h-3 d e g+e^2 f\right )+b \left (3 d e^2 f-d^3 h\right )\right )+c^2 d^2 (3 e f-d g)\right )}{2 \left (a e^2-b d e+c d^2\right )^3}+\frac{\log (d+e x) \left (e^3 \left (a^2 h-a b g+b^2 f\right )-c \left (a e \left (3 d^2 h-3 d e g+e^2 f\right )+b \left (3 d e^2 f-d^3 h\right )\right )+c^2 d^2 (3 e f-d g)\right )}{\left (a e^2-b d e+c d^2\right )^3}-\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (-c \left (2 a^2 e^2 (e g-3 d h)-3 a b e \left (d^2 (-h)-d e g+e^2 f\right )+b^2 \left (-\left (d^3 h+3 d e^2 f\right )\right )\right )-b e^3 \left (a^2 h-a b g+b^2 f\right )-c^2 d \left (2 a \left (d^2 h-3 d e g+3 e^2 f\right )+b d (d g+3 e f)\right )+2 c^3 d^3 f\right )}{\sqrt{b^2-4 a c} \left (a e^2-b d e+c d^2\right )^3}-\frac{d^2 h-d e g+e^2 f}{2 e (d+e x)^2 \left (a e^2-b d e+c d^2\right )}-\frac{a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )+c d (2 e f-d g)}{(d+e x) \left (a e^2-b d e+c d^2\right )^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 1.25078, antiderivative size = 509, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {1628, 634, 618, 206, 628} \[ -\frac{\log \left (a+b x+c x^2\right ) \left (e^3 \left (a^2 h-a b g+b^2 f\right )-a c e \left (3 d^2 h-3 d e g+e^2 f\right )-b c \left (3 d e^2 f-d^3 h\right )+c^2 d^2 (3 e f-d g)\right )}{2 \left (a e^2-b d e+c d^2\right )^3}+\frac{\log (d+e x) \left (e^3 \left (a^2 h-a b g+b^2 f\right )-a c e \left (3 d^2 h-3 d e g+e^2 f\right )-b c \left (3 d e^2 f-d^3 h\right )+c^2 d^2 (3 e f-d g)\right )}{\left (a e^2-b d e+c d^2\right )^3}-\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (-c \left (2 a^2 e^2 (e g-3 d h)-3 a b e \left (d^2 (-h)-d e g+e^2 f\right )+b^2 \left (-\left (d^3 h+3 d e^2 f\right )\right )\right )-b e^3 \left (a^2 h-a b g+b^2 f\right )-c^2 d \left (2 a \left (d^2 h-3 d e g+3 e^2 f\right )+b d (d g+3 e f)\right )+2 c^3 d^3 f\right )}{\sqrt{b^2-4 a c} \left (a e^2-b d e+c d^2\right )^3}-\frac{d^2 h-d e g+e^2 f}{2 e (d+e x)^2 \left (a e^2-b d e+c d^2\right )}-\frac{a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )+c d (2 e f-d g)}{(d+e x) \left (a e^2-b d e+c d^2\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1628
Rule 634
Rule 618
Rule 206
Rule 628
Rubi steps
\begin{align*} \int \frac{f+g x+h x^2}{(d+e x)^3 \left (a+b x+c x^2\right )} \, dx &=\int \left (\frac{e^2 f-d e g+d^2 h}{\left (c d^2-b d e+a e^2\right ) (d+e x)^3}+\frac{e \left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right )}{\left (c d^2-b d e+a e^2\right )^2 (d+e x)^2}+\frac{e \left (c^2 d^2 (3 e f-d g)+e^3 \left (b^2 f-a b g+a^2 h\right )-a c e \left (e^2 f-3 d e g+3 d^2 h\right )-b c \left (3 d e^2 f-d^3 h\right )\right )}{\left (c d^2-b d e+a e^2\right )^3 (d+e x)}+\frac{c^3 d^3 f-b e^3 \left (b^2 f-a b g+a^2 h\right )+c e^2 \left (3 b^2 d f+a b (2 e f-3 d g)-a^2 (e g-3 d h)\right )-c^2 d \left (3 b d e f+a \left (3 e^2 f-3 d e g+d^2 h\right )\right )-c \left (c^2 d^2 (3 e f-d g)+e^3 \left (b^2 f-a b g+a^2 h\right )-a c e \left (e^2 f-3 d e g+3 d^2 h\right )-b c \left (3 d e^2 f-d^3 h\right )\right ) x}{\left (c d^2-b d e+a e^2\right )^3 \left (a+b x+c x^2\right )}\right ) \, dx\\ &=-\frac{e^2 f-d e g+d^2 h}{2 e \left (c d^2-b d e+a e^2\right ) (d+e x)^2}-\frac{c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )}{\left (c d^2-b d e+a e^2\right )^2 (d+e x)}+\frac{\left (c^2 d^2 (3 e f-d g)+e^3 \left (b^2 f-a b g+a^2 h\right )-a c e \left (e^2 f-3 d e g+3 d^2 h\right )-b c \left (3 d e^2 f-d^3 h\right )\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^3}+\frac{\int \frac{c^3 d^3 f-b e^3 \left (b^2 f-a b g+a^2 h\right )+c e^2 \left (3 b^2 d f+a b (2 e f-3 d g)-a^2 (e g-3 d h)\right )-c^2 d \left (3 b d e f+a \left (3 e^2 f-3 d e g+d^2 h\right )\right )-c \left (c^2 d^2 (3 e f-d g)+e^3 \left (b^2 f-a b g+a^2 h\right )-a c e \left (e^2 f-3 d e g+3 d^2 h\right )-b c \left (3 d e^2 f-d^3 h\right )\right ) x}{a+b x+c x^2} \, dx}{\left (c d^2-b d e+a e^2\right )^3}\\ &=-\frac{e^2 f-d e g+d^2 h}{2 e \left (c d^2-b d e+a e^2\right ) (d+e x)^2}-\frac{c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )}{\left (c d^2-b d e+a e^2\right )^2 (d+e x)}+\frac{\left (c^2 d^2 (3 e f-d g)+e^3 \left (b^2 f-a b g+a^2 h\right )-a c e \left (e^2 f-3 d e g+3 d^2 h\right )-b c \left (3 d e^2 f-d^3 h\right )\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^3}-\frac{\left (c^2 d^2 (3 e f-d g)+e^3 \left (b^2 f-a b g+a^2 h\right )-a c e \left (e^2 f-3 d e g+3 d^2 h\right )-b c \left (3 d e^2 f-d^3 h\right )\right ) \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{2 \left (c d^2-b d e+a e^2\right )^3}+\frac{\left (2 c^3 d^3 f-b e^3 \left (b^2 f-a b g+a^2 h\right )-c^2 d \left (b d (3 e f+d g)+2 a \left (3 e^2 f-3 d e g+d^2 h\right )\right )-c \left (2 a^2 e^2 (e g-3 d h)-3 a b e \left (e^2 f-d e g-d^2 h\right )-b^2 \left (3 d e^2 f+d^3 h\right )\right )\right ) \int \frac{1}{a+b x+c x^2} \, dx}{2 \left (c d^2-b d e+a e^2\right )^3}\\ &=-\frac{e^2 f-d e g+d^2 h}{2 e \left (c d^2-b d e+a e^2\right ) (d+e x)^2}-\frac{c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )}{\left (c d^2-b d e+a e^2\right )^2 (d+e x)}+\frac{\left (c^2 d^2 (3 e f-d g)+e^3 \left (b^2 f-a b g+a^2 h\right )-a c e \left (e^2 f-3 d e g+3 d^2 h\right )-b c \left (3 d e^2 f-d^3 h\right )\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^3}-\frac{\left (c^2 d^2 (3 e f-d g)+e^3 \left (b^2 f-a b g+a^2 h\right )-a c e \left (e^2 f-3 d e g+3 d^2 h\right )-b c \left (3 d e^2 f-d^3 h\right )\right ) \log \left (a+b x+c x^2\right )}{2 \left (c d^2-b d e+a e^2\right )^3}-\frac{\left (2 c^3 d^3 f-b e^3 \left (b^2 f-a b g+a^2 h\right )-c^2 d \left (b d (3 e f+d g)+2 a \left (3 e^2 f-3 d e g+d^2 h\right )\right )-c \left (2 a^2 e^2 (e g-3 d h)-3 a b e \left (e^2 f-d e g-d^2 h\right )-b^2 \left (3 d e^2 f+d^3 h\right )\right )\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{\left (c d^2-b d e+a e^2\right )^3}\\ &=-\frac{e^2 f-d e g+d^2 h}{2 e \left (c d^2-b d e+a e^2\right ) (d+e x)^2}-\frac{c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )}{\left (c d^2-b d e+a e^2\right )^2 (d+e x)}-\frac{\left (2 c^3 d^3 f-b e^3 \left (b^2 f-a b g+a^2 h\right )-c^2 d \left (b d (3 e f+d g)+2 a \left (3 e^2 f-3 d e g+d^2 h\right )\right )-c \left (2 a^2 e^2 (e g-3 d h)-3 a b e \left (e^2 f-d e g-d^2 h\right )-b^2 \left (3 d e^2 f+d^3 h\right )\right )\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{\sqrt{b^2-4 a c} \left (c d^2-b d e+a e^2\right )^3}+\frac{\left (c^2 d^2 (3 e f-d g)+e^3 \left (b^2 f-a b g+a^2 h\right )-a c e \left (e^2 f-3 d e g+3 d^2 h\right )-b c \left (3 d e^2 f-d^3 h\right )\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^3}-\frac{\left (c^2 d^2 (3 e f-d g)+e^3 \left (b^2 f-a b g+a^2 h\right )-a c e \left (e^2 f-3 d e g+3 d^2 h\right )-b c \left (3 d e^2 f-d^3 h\right )\right ) \log \left (a+b x+c x^2\right )}{2 \left (c d^2-b d e+a e^2\right )^3}\\ \end{align*}
Mathematica [A] time = 0.902485, size = 504, normalized size = 0.99 \[ -\frac{\log (d+e x) \left (e^3 \left (-\left (a^2 h-a b g+b^2 f\right )\right )+a c e \left (3 d^2 h-3 d e g+e^2 f\right )+b c \left (3 d e^2 f-d^3 h\right )+c^2 d^2 (d g-3 e f)\right )}{\left (e (a e-b d)+c d^2\right )^3}+\frac{\log (a+x (b+c x)) \left (e^3 \left (-\left (a^2 h-a b g+b^2 f\right )\right )+a c e \left (3 d^2 h-3 d e g+e^2 f\right )+b c \left (3 d e^2 f-d^3 h\right )+c^2 d^2 (d g-3 e f)\right )}{2 \left (e (a e-b d)+c d^2\right )^3}+\frac{\tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right ) \left (-c \left (-2 a^2 e^2 (e g-3 d h)+3 a b e \left (d^2 (-h)-d e g+e^2 f\right )+b^2 \left (d^3 h+3 d e^2 f\right )\right )+b e^3 \left (a^2 h-a b g+b^2 f\right )+c^2 d \left (2 a \left (d^2 h-3 d e g+3 e^2 f\right )+b d (d g+3 e f)\right )-2 c^3 d^3 f\right )}{\sqrt{4 a c-b^2} \left (e (b d-a e)-c d^2\right )^3}-\frac{d^2 h-d e g+e^2 f}{2 e (d+e x)^2 \left (e (a e-b d)+c d^2\right )}+\frac{a e (2 d h-e g)+b \left (e^2 f-d^2 h\right )+c d (d g-2 e f)}{(d+e x) \left (e (a e-b d)+c d^2\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.194, size = 1945, normalized size = 3.8 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.26058, size = 1353, normalized size = 2.66 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]